project(test_occ_7_8_0_upgrade_performance)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 文件归类
file(GLOB SRC_FILES *.h *.cpp)

# opencascade
find_package(OpenCasCade COMPONENTS Kernel REQUIRED)

include_directories(SYSTEM ${OpenCASCADE_INCLUDE_DIR})
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/occ)

add_executable(${PROJECT_NAME} ${SRC_FILES} ${OCC_FILES})

# 工程配置
foreach (CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
	if (${CONFIG_TYPE} STREQUAL "Debug")
		foreach (LIB ${OpenCASCADE_LIBRARIES})
			target_link_libraries(${PROJECT_NAME} debug ${OpenCASCADE_LIBRARY_DIR}/${LIB}.lib)
		endforeach()
	else()
		foreach (LIB ${OpenCASCADE_LIBRARIES})
			target_link_libraries(${PROJECT_NAME} optimized ${OpenCASCADE_LIBRARY_DIR}/${LIB}.lib)
		endforeach()
	endif()
endforeach()

# 安装
INSTALL(TARGETS ${PROJECT_NAME})

file(GLOB OCC_DLLS ${OpenCASCADE_BINARY_DIR}/*.dll)
INSTALL(FILES ${OCC_DLLS} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
